const { defineConfig } = require('@vue/cli-service')
const path = require('path')
module.exports = defineConfig({
  devServer: {
    host: 'location',// 使用花生壳之类的 需改为 0.0.0.0
    port: '8089', // 端口号
    https: false, // 是否支持https
    open: false, // 配置自动启动浏览器
    proxy: {
      '/api': {
        target: process.env.VUE_APP_BASE_URL,
        ws: true,
        changeOrigin: true
      },
    }
  },
  publicPath: process.env.NODE_ENV === 'production' ? '/h5' : '',
  transpileDependencies: true,
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      resolveUrl: false,
      patterns: [path.resolve(__dirname, "./src/assets/css/base.less")],
    },
  },
  productionSourceMap: process.env.NODE_ENV === 'production' ? false : true
})
